If they have brains they are capable of reasoning, after all that's what brains do. Human have big brains and so are capable of somewhat more complicated reasoning.
The bible speaks as if animals don't think, but they do, because they have brains they only don't have the processing power of our big brains.
The monkey in the tree knows that if he lets go he will fall down.